﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Media.Media3D;
using NUnit.Framework;
using GeometryViz3D.Model;

namespace UnitTests.Model
{
    [TestFixture]
	public class G3DLineTester
	{
        [Test]
        public void TestProperties()
        {
            G3DPoint p1 = new G3DPoint()
            {
                Label = "A",
                Position = new Point3D(1.0, 2.0, 3.0)
            };

            G3DPoint p2 = new G3DPoint()
            {
                Label = "B",
                Position = new Point3D(-1.0, -2.0, -3.0)
            };

            G3DLine line = new G3DLine()
            {
                Label = "AB",
                StartPoint = p1,
                EndPoint = p2
            };

            Assert.AreEqual("AB", line.Label);
            Assert.AreEqual(p1, line.StartPoint);
            Assert.AreEqual(p2, line.EndPoint);
        }

        [Test]
        public void TestEquality()
        {
            G3DLine l1 = new G3DLine() { Label = "l1" };
            G3DLine l2 = new G3DLine() { Label = "l1" };

            Assert.IsTrue(l1.Equals(l2));

            l2.Label = "l2";
            Assert.IsFalse(l1.Equals(l2));

            Assert.IsFalse(l1.Equals(null));
            Assert.IsFalse(l1.Equals(new G3DPoint()));
        }
	}
}
